import { defineStore } from 'pinia'
import { getMusicPlayApi } from '@/api/category/getSongLists'

const initState = {
  url: [],
}
export const useMusicPlayStore = defineStore('MusicPlay', {
  state: (): { url: string[] } => initState,
  actions: {
    async getMusicPlay(id: string) {
      const res = await getMusicPlayApi(id)
      this.url.push(res.data.playUrl[id].url)
      console.log(this.url)
    },
  },
})
